package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据dish id集合查询
     * @param dishIds
     * @return
     */
    List<Long> getIdsByDishIds(List<Long> dishIds);

    /**
     * 批量添加套餐的菜品数据
     * @param setmealDishes
     */

    void insertBatch(List<SetmealDish> setmealDishes);

    @Select("select * from setmeal_dish where setmeal_id = #{setmealId};")
    List<SetmealDish> getBySetmealId(Long setmealId);

    /**
     * 通过setmealId批量删除菜品
     * @param ids
     */
    void deleteBySetmealIds(List<Long> ids);


    /**
     * 通过setmealIds集合获取dishIds集合
     * @param setmealIds
     * @return
     */
    List<Long> getDishIdsByDishIds(List<Long> setmealIds);
}
